<template>
  <div class="com-container">
    <div ref="oilPressure" class="com-chart"></div>
  </div>
</template>
<script setup name="OilPressureCom">
import { shallowRef, onMounted, onBeforeUnmount } from 'vue'
import { useOilPressure } from '../hooks/useOilPressure'
const { registerOilPressure, initChart, screenAdapter } = useOilPressure()
const oilPressure = shallowRef()
onMounted(() => {
  registerOilPressure(oilPressure.value)
  initChart()
  window.addEventListener('resize', screenAdapter)
  screenAdapter()
})
onBeforeUnmount(() => {
  window.removeEventListener('resize', screenAdapter)
})
</script>
<style lang="less" scoped></style>
